package cn.edu.zjut.mina.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import cn.edu.zjut.mina.service.IInquireService;

@Controller
@RestController
@RequestMapping("/inquire")
public class InquireAction {
	
	@Qualifier("inquireService")
	@Autowired
	private IInquireService inquireService;
	/**
	 * 查询战绩
	 * @param userId  请求用户的Id
	 * @param page   请求第几页
	 * @param pagenum   每页请求多少条 信息
	 * @return
	 */
	@RequestMapping(value="/combatgains", produces = "application/json;charset=UTF-8")
	public String combatGains(@RequestParam("userId")String userId, @RequestParam("page")int page, @RequestParam("pagenum")int pagenum){
		
		return inquireService.inquireTotal(userId, page, pagenum);
	}
	
	/**
	 * 查询战绩综述
	 * @param userId  请求用户的Id
	 * @param page   请求第几页
	 * @param pagenum   每页请求多少条 信息
	 * @return
	 */
	@RequestMapping(value="/combatgainssummarize", produces = "application/json;charset=UTF-8")
	public String combatGainsSummarize(@RequestParam("userId")String userId, @RequestParam("page")int page, @RequestParam("pagenum")int pagenum){
		
		return inquireService.inquireSummarize(userId, page, pagenum);
	}
	
	/**
	 * 查询战绩Item
	 * @param totalGameResultId
	 * @return
	 */
	@RequestMapping(value="/combatgainsitem", produces = "application/json;charset=UTF-8")
	public String combatGainsItem(@RequestParam("totalGameResultId")int totalGameResultId){
		
		return inquireService.inquireItem(totalGameResultId);
	}
}
